package com.example.designpattern.singleExample;

/**
 * @program: DesignPattern
 * @description: 懒汉式创建单例模式
 * @author: zhangjt
 * @create: 2024-11-14 14:44
 **/
public class LazyCreateBean {
    private static LazyCreateBean instance;

    private LazyCreateBean(){}

    public static LazyCreateBean getInstance(){
        if (instance == null){
            instance = new LazyCreateBean();
        }
        return instance;
    }
}
